<% content_for :css do %>
  <%= stylesheet_link_tag 'users_edit' %>
<% end %>
<% content_for :javascript do %>
<script type="text/javascript" charset="utf-8">
  function send_check_code_failed(state) 
  {
    if(state == 'SSI_NEED_VERIFY' || state == 'SSI_VERIFY_FAIL') 
    {
      <%= remote_function :update => :verify,
            :url => verify_fetion_url,
            :with => "'&mobile=' + $F('user_mobile')",
            :method => :get %>
      alert('发送失败，' + fetion_sm_state_name(state));
      $('verify').show();
      $('get_check_code_sm').innerHTML = '获取确认码短信';
    } else if(state != 'SUCCESS') 
    {
      alert('发送失败，' + fetion_sm_state_name(state));
      $('get_check_code_sm').innerHTML = '获取确认码短信';
    }    
    
  }
  
  function send_check_code()
  {
    if($F('verify_code') == "请输入右侧图片中的验证码 =>")
    {
      alert("请输入右侧图片中的验证码");
    }
    else
    {
    <%= remote_function :url => send_check_code_sm_fetions_url,
          :loading => "$('get_check_code_sm').innerHTML = '发送中...'",
          :success => "$('get_check_code_sm').innerHTML = '获取确认码短信';alert('发送成功，请您及时查阅手机');$('verify').hide();$('verify_code').value='';$('verify_image_id').value='';$('user_check_code').focus()",
          :failure => "send_check_code_failed(request.responseText)",  
          :method => :post,  
          :with => "'mobile=' + $F('user_mobile') + '&fetion_password=' + $F('user_encrypted_fetion_password') + '&fetion_verify_code=' + $F('verify_code')+ '&fetion_verify_image_id=' + $F('verify_image_id')" %>
    }
  }
  
  function next_feed(feeds_id) {
    var current = null;
    var next = null;
    $$('dl#' + feeds_id + ' dd.feed').each(function (feed) {
      if(next == null) {
        if(current != null) {
          next = feed;
        } else {
          if(feed.style.display == '') {
            current = feed;
            current.hide();
          }  
        }
      }
    });
    if(current != null && next == null) {
      next = $$('dd.feed')[0];
    }
    Effect.Appear(next)
  }
</script>
<% end %>  
<%= render :file => 'users/_level2_nav_bar.html', :locals => { :item => :personal_info} %>
<div id="user_logo" >
  <div class='logo'>
    <%= current_user_logo_image_tag :width => 180 %>  
  </div>
  <div id='change_logo'>
    <%= link_to_new_or_edit_current_user_logo %>
  </div>
</div>
<div class="prepend-5 span-19" id="main">
  <div id="main_c">
    <div id="items_desc">
      <h1>我的信息</h1>
      <div id="base_info" class='block'>
        <%= render :file => 'users/show_base_info.js' %>
      </div>
      <div id="fetion" class='block'>
        <%= render :file => 'users/show_fetion.js' %>
      </div>  
      <div id="password" class='block'>
        <%= render :file => 'users/show_password.js' %>
      </div>
    </div>   
  </div>
</div>
<% if params[:target] == 'mobile' %>
  <script type="text/javascript" charset="utf-8">
    Effect.Pulsate('fetion',{duration:4.0});
    Effect.ScrollTo('main_c',{duration:2.0});
    <% if not current_user.mobile? %>
    $('edit_fetion_link').onclick();
    <% end %>
  </script>
<% end %>